﻿#pragma once
#include <array>
#include <vector>

#include "Scence.h"

class FTexture2D;
class FMesh;
class FMaterial;
class FRanderTarget;
struct FDirectionLight;
struct FSpotLight;
struct FPointLight;
class FLightBase;

class FShadowScence final
	: public FScence
{
public:
	void Init(FRender* InRender) override;
	void Destory() override;
	void Draw(float DateTime) override;
	std::shared_ptr<FCamera> GetCamera() const override {return  Camera; }

private:

	std::shared_ptr<FMesh>	ImgMesh;

	std::shared_ptr<FMesh> TestMesh;
	std::shared_ptr<FTexture2D> RttTexture;

	std::shared_ptr<FCamera> Camera;

	std::shared_ptr<FRanderTarget> RanderTarget;

	std::vector<std::shared_ptr<FLightBase>> LightArray;
	std::array<std::shared_ptr<FPointLight>, 4> PointLightArr;
	std::shared_ptr<FSpotLight> Spotlight;
	std::shared_ptr<FDirectionLight> DirectionLight;

	std::shared_ptr<FMaterial> ShadowDepthMaterial;
	std::shared_ptr<FMaterial> CubeMaterial;

	glm::mat4 LightPvMat = glm::mat4(1.f);

	bool DrawShadowDepth = false;
};
